/**
* @file			main.c
* @author  		Diluka Harischandra ST2000429
* @version 		1.0
* @date    		December 7, 2014
* @brief   		Smart Home main program.
*/

/* Includes ------------------------------------------------------------------*/
#include "arduino.h"

#include "sic4310.h"

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
char bluetooth_pin[4] = {'2','5','1','1'}; // Bluetooth pin number (password)
int j;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/




/**
* @brief	The setup() function will only run once, after each powerup or reset of the board. Use it to initialize variables, pin modes, start using libraries, etc.
* @param	None
* @retval	None
*/
void setup()
{
}


/**
* @brief	The loop() function does loop consecutively, allowing your program to change and respond. Use it to actively control the board.
* @param	None
* @retval	None
*/
void loop()
{
	
	//print bluetooth PIN/Password to SIC4310 so that the user can see the pin code via NFC and pair with Bluetooth module.
  for(j = 0; j<4; j++)
	{		
		  SIC4310_write(bluetooth_pin[j]);
	}
	SIC4310_write('\n');		
			
			
	delay(1000);
		
}


/**
* @brief	Template main function
* @param	None
* @retval	None
*/
int main() 
{
	
	platform_config();
	SIC4310_config();
	setup();
	while(1) {
		loop();
	}
}
